<?php

namespace app\common\model;

use think\Model;
use think\model\concern\SoftDelete;

class System extends Model
{
    //软删除
    use SoftDelete;

    //编辑
    public function edit($data){
        $validate = new \app\common\validate\System();
        if (!$validate->check($data)){
            return $validate->getError();
        }
        $systems = $this->find();
        $systems->webname = $data['webname'];
        $systems->copyright = $data['copyright'];
        $result =  $systems->save();
        if ($result){
            return 1;
        }else{
            return "更新失败";
        }
    }
}
